package com.yanqu.road.entity.activity.selectlottery.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_activity_select_lottery_notice_data", desc = "通用自选抽奖-公告表")
public class SelectLotteryNoticeData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "玩家ID")
    private long userId;

    @FieldTypeAnnotation(desc = "区服ID")
    private int serverId;

    @FieldTypeAnnotation(desc = "奖励配置ID")
    private int rewardId;

    @FieldTypeAnnotation(desc = "昵称")
    private String nickName;

    @FieldTypeAnnotation(desc = "时间")
    private long time;

    public SelectLotteryNoticeData() {
    }

    public SelectLotteryNoticeData(int activityId, long userId, int serverId, int rewardId, String nickName, long time) {
        this.activityId = activityId;
        this.userId = userId;
        this.serverId = serverId;
        this.rewardId = rewardId;
        this.nickName = nickName;
        this.time = time;
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getServerId() {
        return serverId;
    }
    public void setServerId(int serverId) {
        if (this.serverId != serverId) {
            this.serverId = serverId;
            setOp(DataStatus.Update);
        }
    }

    public int getRewardId() {
        return rewardId;
    }
    public void setRewardId(int rewardId) {
        if (this.rewardId != rewardId) {
            this.rewardId = rewardId;
            setOp(DataStatus.Update);
        }
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        if (!Objects.equals(this.nickName, nickName)) {
            this.nickName = nickName;
            setOp(DataStatus.Update);
        }
    }

    public long getTime() {
        return time;
    }
    public void setTime(long time) {
        if (this.time != time) {
            this.time = time;
            setOp(DataStatus.Update);
        }
    }
}
